package com.guigu.controller.lq.controller;

import com.guigu.controller.lq.pojo.*;
import com.guigu.controller.lq.service.*;
import com.guigu.pojo.Vip;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class LqGyfaController {
    @Autowired
    LqVipSetvice lqVipSetvice;
    @Autowired
    LqPhysicaljgservice lqPhysicaljgservice;
    @Autowired
    LqPsychologyjgService lqPsychologyjgService;
    @Autowired
    LqModelService lqModelService;
    @Autowired
    LqGyfaService lqGyfaService;
    @RequestMapping("/gy")
    public PageVO <Vip> findgy(@RequestBody PageVO pageVO){
        PageVO<Vip> findgy = lqVipSetvice.findgy(pageVO.getPage(), pageVO.getNum(), pageVO.getVipname());
        return findgy;
    }
    @RequestMapping("/mbgy")
    public List<LqModel> findmbgy(){
        List<LqModel> findmbgy = lqModelService.findmbgy(new LqModel());
        return findmbgy;
    }
    @RequestMapping("/addgy")
    public int addgy(@RequestBody  LqGyfa lqGyfa){
        LqMake lqMake = new LqMake();
        lqMake.setGyzt(2);
        int addgy = lqGyfaService.addgy(lqGyfa);

        return addgy;
    }
    @RequestMapping("/upgy")
    public int upgy(@RequestBody LqGyfa lqGyfa){
        int upgy = lqGyfaService.upgy(lqGyfa);
        return upgy;
    }
    @RequestMapping("/selgy")
    public LqGyfa selgy(@RequestBody LqGyfa lqGyfa){
        LqGyfa selgy = lqGyfaService.selgy(lqGyfa.getVipid());
        return selgy;
    }

}
